#!/usr/bin/python
# -*- encoding:utf-8 -*-

import urllib2
import socket
socket.setdefaulttimeout(5)

domains = ['www.baidu.com', 'www.vip.com', 'www.google.com', 'impulse101.net']

for domain in domains:
    url = 'http://' + domain + '/phpinfo.php'
    try:
        req = urllib2.urlopen(url)
        print url,req.msg
        if req.msg == 'OK':
            htmlContent = req.read()
            if '<title>phpinfo()</title>' in htmlContent:
                print url, 'find phpinfo() page!!!'
    except Exception, e:
        print url,e